package cn.foo.service.impl;

import cn.foo.dao.UserDao;
import cn.foo.pojo.User;
import cn.foo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Frank
 * @date 07-06
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public User login(String userCode, String userPassword) {
        User user = userDao.getLoginUser(userCode);
        if(user!=null && userPassword.equals(user.getUserPassword())){
            return user;//用户名和密码正确
        }
        return null;
    }
}
